package com.xoa.controller.party;


import com.xoa.model.party.trashMiniature;
import com.xoa.service.party.TrashMiniatureService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.beans.Transient;

@Controller
@RequestMapping("/TrashMiniatureController")
public class TrashMiniatureController {
    @Autowired
    private TrashMiniatureService trashMiniatureService;
    /**
     * 查询
     * @param page
     * @param pageSize
     * @param
     * @return
     */
    @RequestMapping("/trminSelect")
    @ResponseBody
    public ToJson trminSelect(Integer page, Integer pageSize, Integer mid, boolean useFlag, String codeNo){
        return  trashMiniatureService.trminSelect(page,pageSize,mid,useFlag,codeNo);
    }

    @RequestMapping("/trminSelectList")
    @ResponseBody
    public ToJson trminSelectList(Integer page, Integer pageSize, Integer mid, boolean useFlag, trashMiniature trashMiniature){
        return  trashMiniatureService.trminSelectList(page,pageSize,mid,useFlag,trashMiniature);
    }

    @RequestMapping("/trminBySelect")
    @ResponseBody
    public ToJson trminBySelect(){
        return  trashMiniatureService.trminBySelect();
    }

    /**
     * 删除
     * @param mid
     * @return
     */
    @RequestMapping("/deleteTrmin")
    @ResponseBody
    public ToJson delete(Integer mid){
        return  trashMiniatureService.delete(mid);
    }

    /**
     * 修改
     * @param
     * @return
     */
    @RequestMapping("/updateTrmin")
    @ResponseBody
    public ToJson update(trashMiniature trashMiniature){
        return trashMiniatureService.update(trashMiniature);
    }

    /**
     * 添加
     */
    @RequestMapping("/addTrmin")
    @ResponseBody
    public ToJson add(trashMiniature trashMiniature){
        return trashMiniatureService.add(trashMiniature);
    }


    @RequestMapping("/ecoudInsert")
    @ResponseBody
    @Transient
    public ToJson ecoudInsert(MultipartFile file){
        return trashMiniatureService.ecoudInsert(file);
    }
}
